{% extends "blog/base_blog.html" %}

{% load i18n %}

{% block title %}{% trans "Post search" %}{% endblock %}
{% block body_class %}{{ block.super }} post_search{% endblock %}


{% block content_title %}
  <h2>{% trans "Search" %}</h2>
{% endblock %}


{% block content %}
  <form action="." method="get" id="post_search_form">
    <p>
      <input type="text" name="q" value="{{ search_term }}" id="search">
      <input type="submit" class="button" value="{% trans "Search" %}">
    </p>
  </form>
  
  {% if message %}
  <p class="message">{{ message }}</p>
  {% endif %}
  
  {% if object_list %}
  <div class="post_list">
    {% for post in object_list %}
    <div>
      <h3 class="title"><a href="{{ post.get_absolute_url }}" title="{% trans "View this post" %}">{{ post.title }}</a></h3>
      <p class="date">{{ post.publish|date:"Y F d" }}</p>
      <p class="tease">{{ post.tease|safe }}</p>
      <p class="comments">{% if comment_count %}{{ comment_count }} {% blocktrans with comment_count|pluralize as pluralize %}comment{{ pluralize }}{% endblocktrans %}{% endif %}</p>
    </div>
    {% endfor %}
  </div>
  {% endif %}
{% endblock %}